<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}
<link rel="stylesheet" href="static/css/statistic.css">
<div class="content fix">

	<div class="mainContent">
		<div class="AgentReport">
			<div class="ptBar">
				<a href="">首页</a> > 统计报表 > 终端报表
			</div>
			<input type="hidden" name="m" value="{$m}" />
			<input type="hidden" name="c" value="{$c}" />
			<input type="hidden" name="a" value="{$a}" />
			<div  class="tableFilter">
				<div  class="tableFilterInput">
					<em>开始时间</em>  
					<input name="btime" id="search_btime" type="text" value="{$searchBtime}" class="layui-input date datetimepicker8" style="width:100px;" placeholder="开始日期" />
					<em>结束时间</em>
					<input name="etime" id="search_etime" type="text" value="{$searchEtime}" class="layui-input date datetimepicker8" style="width:100px;" placeholder="结束日期" />
				</div>
				<div class="tableButton">
					<a class="dark" id="id_search_form">
						<i class="iconfont"></i>查询
					</a> 
					<a class="dark" style="display: none;">导出Excel</a>
				</div>
			</div>
			<div class="tableList">
				<table>
					<tbody>
						<tr>
							<th width="5%">终端</th>
							<th width="8%">投注人数</th>
							<th width="8%">注册人数</th>
							<th width="8%">充值人数</th>
							<th width="8%">充值金额</th>
							<th width="8%">提现金额</th>
							<th width="8%">投注金额</th>
							<th width="8%">中奖金额</th>
							<th width="8%">投注单量</th>
							<th width="8%">盈利</th>
							<th width="">盈率</th>
						</tr>
					</tbody>
					<tbody id="id_content_tr">
						
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
<input type="hidden" id="requestUrl" value="{U('json/statistic')}"/>
<script type="text/javascript" src="static/js/backend_base.js"></script>
<script>
//获取列表数据
sourceSoco.getData();
fillTable();
function fillTable(){
	// 拿到数据，准备填充页面
	if(sourceSoco.pageList.length){
		$('#id_content_tr').html('');
		var tr_str = '';
		$.each(sourceSoco.pageList, function (i, v){
			tr_str  = '<tr>';
			switch(v.platform){
				case '1':
					tr_str += '		<td>PC</td>';
					break;
				case '2':
					tr_str += '		<td>mobile</td>';
	    			break;
			}
			tr_str += '		<td>' + v.bet_user + '</td>';
			tr_str += '		<td>' + v.reg_nums + '</td>';
			tr_str += '		<td>-</td>';
			tr_str += '		<td>-</td>';
			tr_str += '		<td>' + v.cash_amount + '</td>';
			tr_str += '		<td>' + v.bet_amount +'</td>';
			tr_str += '		<td>' + v.prize_amount + '</td>';
			tr_str += '		<td>' + v.bet_orders + '</td>';
			tr_str += '		<td>' + v.profit + '</td>';
			tr_str += '		<td>' + v.profit_raft + '</td>';
			tr_str += '</tr>';
			$('#id_content_tr').append(tr_str);
		})
	}else{
		$('#id_content_tr').append('<tr><td colspan="11" style="text-align: center;">暂无数据</td></tr>');
	}
}

$('#id_search_form').on('click', '', function (){
	if($.isEmptyObject($('#search_btime').val()) || $.isEmptyObject($('#search_btime').val())) return;
	sourceSoco.getData();
	fillTable();
})
</script>
<script type="text/javascript" src="static/js/datetime.js"></script>
{template index/footer}
